package com.supermarket.manage.common.validation;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author Faxon
 * @version 1.0
 * @date 2020-03-12 19:44
 **/
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Constraint(
        validatedBy = {DiscountValidator.class}
)
public @interface Discount {
    boolean required() default true;

    String message() default "折扣范围为（0 - 10）";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
